﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Algorithm.Offer_Easy_42_RecentCounter
{
    class MainProject
    {
    }
    public class RecentCounter
    {
        private Queue<int> m_Que = new Queue<int>();
        public RecentCounter()
        {

        }

        public int Ping(int t)
        {
            m_Que.Enqueue(t);
            while (m_Que.Peek() < (t - 3000)) m_Que.Dequeue();
            return m_Que.Count;
        }
    }
}
